interface Gentleman {
    default void greet() {
        System.out.println("Hello, from Gentleman");
    }
}

class Grandpa implements Gentleman {
    public Grandpa() {
        System.out.println("Grandpa constructor");
    }
}

class Parent extends Grandpa {
    public Parent() {
        System.out.println("Parent constructor");
    }

    @Override
    public void greet() {
        System.out.println("Hello, from Parent");
    }
}

class Child extends Parent {
    public Child() {
        System.out.println("Child constructor");
    }

    @Override
    public void greet() {
        System.out.println("Hello, from Child");
    }
}

public class Greeter {
    public static void main(String[] args) {
        Gentleman g = new Grandpa();
        Gentleman p = new Parent();
        Gentleman c = new Child();

        g.greet();
        System.out.println();

        p.greet();
        System.out.println();

        p.greet();
        System.out.println();

        c.greet();
        System.out.println();
    }
}
